package cn.iocoder.yudao.module.wine.controller.app.businessuserlog;

import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.wine.controller.app.businessuserlog.vo.AppBusinessUserRespVO;
import cn.iocoder.yudao.module.wine.dal.dataobject.businessuserlog.BusinessUserLogDO;
import cn.iocoder.yudao.module.wine.service.businessuserlog.BusinessUserLogService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

import java.util.List;

import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

/**
 * @author zyc
 * @createDate 2024/6/5 10:20
 */
@Tag(name = "用户 APP - 系统日志消息模块")
@RestController
@RequestMapping("/wine/business-user-log")
@Validated
public class AppBusinessUserLogController {

    @Resource
    private BusinessUserLogService businessUserLogService;

    @GetMapping("/info")
    @Operation(summary = "查看审核日志详情")
    public CommonResult<AppBusinessUserRespVO> getBusinessUserInfo(@RequestParam("id") Long id) {
        BusinessUserLogDO businessUserLog = businessUserLogService.getBusinessUserLog(id);
        return success(BeanUtils.toBean(businessUserLog,AppBusinessUserRespVO.class));
    }

    @GetMapping("/list")
    @Operation(summary = "查看关于我的审核日志列表")
    public CommonResult<List<AppBusinessUserRespVO>> getBusinessUserInfo() {
        List<BusinessUserLogDO> businessUserLog = businessUserLogService.appGetBusinessUserLogList();
        return success(BeanUtils.toBean(businessUserLog,AppBusinessUserRespVO.class));
    }

}
